Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report message in handler heartbeat #2688

Merged
merged 7 commits into from
Oct 31, 2022

Conversation

maddieford
Copy link
Contributor

Description

This PR updates the agent to report the extension handler heartbeat message. Previously, any message in heartbeat.log was ignored.

Issue #


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made

Quality of Code and Contribution Guidelines

@@ -1001,6 +1001,7 @@ def report_ext_handler_status(self, vm_status, ext_handler, goal_state_changed):
heartbeat = ext_handler_i.collect_heartbeat()
if heartbeat is not None:
handler_status.status = heartbeat.get('status')
handler_status.message = parse_formatted_message(heartbeat.get('formattedMessage'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should check that the heartbeat actually has a 'formattedMessage')

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need extra check. The get call would handle if it's not available. It will return None if property does not present and same applies to status field.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nagworld9 we need the check so that we do not assign None to these properties

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. At this point we are overriding the handler status file content with heartbeat not with default None values. So makes sense to check here.

@codecov
Copy link

codecov bot commented Oct 21, 2022

Codecov Report

Merging #2688 (3c5f9d0) into develop (a906320) will increase coverage by 0.03%.
The diff coverage is 50.00%.

@@             Coverage Diff             @@
##           develop    #2688      +/-   ##
===========================================
+ Coverage    71.98%   72.01%   +0.03%     
===========================================
  Files          104      104              
  Lines        15748    15750       +2     
  Branches      2241     2242       +1     
===========================================
+ Hits         11336    11343       +7     
+ Misses        3896     3892       -4     
+ Partials       516      515       -1     
Impacted Files Coverage Δ
azurelinuxagent/ga/exthandlers.py 86.06% <50.00%> (+0.39%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@maddieford maddieford merged commit a82427f into Azure:develop Oct 31, 2022
@maddieford maddieford deleted the report_heartbeat branch April 7, 2023 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants